﻿
@{
    ViewBag.Title = "您的考试列表";
}

<h2>ExamList</h2>

<table class="table table-hover">
   <thead>
      <tr>
         <th>考试名称</th>
         <th>考试信息</th>
      </tr>
   </thead>
    @ViewBag.StudentExams.Length
   <tbody>
      @for(var i = 0 ; i < @ViewBag.StudentExams.Length; i++)
      {
        <tr>
            <td>@ViewBag.StudentExams[i].Exam.Name</td>
            
            @if(@ViewBag.StudentExams[i].ExamResult != null)
            {
                <td>@ViewBag.StudentExams[i].ExamResult.Score 分 | @ViewBag.StudentExams[i].ExamResult.CreateDate </td>
            }
            else
            {
                <td>
                    没有考过 
                    @Html.ActionLink("点击考试", "AnswerExam", "Student", new { id = @ViewBag.StudentExams[i].Exam.Index }, null)

                </td>
            }
        </tr>

      }

   </tbody>
</table>
